package org.example.controller;

import org.example.api.UserLoginService;
import org.example.domain.query.User;
import org.example.domain.vo.UserInfoVo;
import org.example.service.SysUserService;
import org.example.utils.Response;
import org.example.domain.vo.CaptchaVo;
import org.springframework.web.bind.annotation.*;

@RestController
public class loginController implements UserLoginService {

    private final SysUserService sysUserService;

    public loginController(SysUserService sysUserService) {
        this.sysUserService = sysUserService;
    }

    @Override
    public Response<UserInfoVo> loginUser(User user) {
        return sysUserService.login(user);
    }

    @Override
    public Response<CaptchaVo> getCaptchaCode() {
        return sysUserService.getCaptchaCode();
    }

}
